package com.example.demo.Controller;

import com.example.demo.dao.ResourceRepository;
import com.example.demo.domain.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.sql.Date;

@RestController
public class ResourceController {

    @Autowired
    ResourceRepository resourceRepository;

    @RequestMapping("/savere")
    public Resource save(String name){

        Resource p = resourceRepository.save(new Resource(name,new Date(System.currentTimeMillis())));

        return p;

    }
}
